// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 在线执行代码 POST /sandbox/online/execute */
export async function onlineExecuteCode(
  body: API.ExecuteCodeRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseExecuteCodeResponse>('/sandbox/online/execute', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 判断代码事项是否正确启动 GET /sandbox/status */
export async function fetchStatus(options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/sandbox/status', {
    method: 'GET',
    ...(options || {}),
  });
}
